<HTML><HEAD><TITLE>path(+Graph, +OriginVertex, +TerminusVertex)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(grasper)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>path(+Graph, +OriginVertex, +TerminusVertex)</H1>
Ensures Graph represents a path between OriginVertex and TerminusVertex in Graph.
<DL>
<DT><EM>Graph</EM></DT>
<DD>A graph.
</DD>
<DT><EM>OriginVertex</EM></DT>
<DD>Initial vertex in the path between OriginVertex and TerminusVertex in Graph.
</DD>
<DT><EM>TerminusVertex</EM></DT>
<DD>Final vertex in the path between OriginVertex and TerminusVertex in Graph.
</DD>
</DL>
<H2>Description</H2>
Ensures Graph represents a path between OriginVertex and TerminusVertex in Graph.
<H3>Fail Conditions</H3>
Fails 
			 if Graph is not a graph variable,
			 if OriginVertex does not belong to Graph's vertex-set,
			 if TerminusVertex does not belong to Graph's vertex-set or
			 if Graph can not be constrained to define a path between OriginVertex and TerminusVertex.
			
<H2>Examples</H2>
<PRE>
?- path(G,Origin,Terminus).
No.

?- V`::[]..[1,2,3,4], E`::[]..[[1,2],[1,3],[1,4],[2,4],[3,4]], dirgraph(G,V,E), path(G, 1, 5).
No.

?- V`::[]..[1,2,3,4], E`::[]..[[1,2],[1,3],[1,4],[2,4],[3,4]], dirgraph(G,V,E), path(G, 5, 1).
No.

?- V`::[]..[1,2,3,4], E`::[]..[[1,2],[1,3],[1,4],[2,4],[3,4]], dirgraph(G,V,E), path(G, 4, 1).
No.

?- V`::[]..[1,2,3,4], E`::[]..[[1,2],[1,3],[1,4],[2,4],[3,4]], dirgraph(G,V,E), path(G, 1, 4), graph_labeling(G).
V = [1, 4]
E = [[1, 4]]
G = dirgraph([1, 4], [[1, 4]])
Yes ? ;

V = [1, 3, 4]
E = [[1, 3], [3, 4]]
G = dirgraph([1, 3, 4], [[1, 3], [3, 4]])
Yes ? ;

V = [1, 2, 4]
E = [[1, 2], [2, 4]]
G = dirgraph([1, 2, 4], [[1, 2], [2, 4]])
Yes

?- V`::[]..[1,2,3,4], E`::[]..[[1,2],[1,3],[1,4],[2,1],[2,4],[3,1],[3,4],[4,1],[4,2],[4,3]], undirgraph(G,V,E), path(G, 1, 4), graph_labeling(G).
V = [1, 3, 4]
E = [[1, 3], [3, 1], [3, 4], [4, 3]]
G = undirgraph([1, 3, 4], [[1, 3], [3, 1], [3, 4], [4, 3]])
Yes ? ;

V = [1, 3, 4]
E = [[1, 3], [1, 4], [3, 1], [3, 4], [4, 1], [4, 3]]
G = undirgraph([1, 3, 4], [[1, 3], [1, 4], [3, 1], [3, 4], [4, 1], [4, 3]])
Yes ? ;

V = [1, 2, 4]
E = [[1, 2], [2, 1], [2, 4], [4, 2]]
G = undirgraph([1, 2, 4], [[1, 2], [2, 1], [2, 4], [4, 2]])
Yes ? ;

V = [1, 2, 4]
E = [[1, 2], [1, 4], [2, 1], [2, 4], [4, 1], [4, 2]]
G = undirgraph([1, 2, 4], [[1, 2], [1, 4], [2, 1], [2, 4], [4, 1], [4, 2]])
Yes ? ;

V = [1, 2, 3, 4]
E = [[1, 2], [1, 3], [2, 1], [2, 4], [3, 1], [3, 4], [4, 2], [4, 3]]
G = undirgraph([1, 2, 3, 4], [[1, 2], [1, 3], [2, 1], [2, 4], [3, 1], [3, 4], [4, 2], [4, 3]])
Yes
			</PRE>

</BODY></HTML>
